package com.zkthink.ceres.cms.entity;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

/**
 * <p>
 * 实体类 装修配置表
 * </p>
 *
 * @author kellen
 * @since 2020-05-16
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_cms_template")
@ApiModel(value = "CmsTemplate", description = "装修配置表")
@AllArgsConstructor
public class CmsTemplate extends Entity<Long> {

  private static final long serialVersionUID = 1L;

  /**
   * 自定义页面名称
   */
  @ApiModelProperty(value = "自定义页面名称")
  @Length(max = 100, message = "自定义页面名称长度不能超过100")
  @TableField(value = "name", condition = LIKE)
  @Excel(name = "自定义页面名称")
  private String name;

  /**
   * 配置内容
   */
  @ApiModelProperty(value = "配置内容")
  @TableField("config")
  @Excel(name = "配置内容")
  private String config;

  /**
   * 是否自定义
   */
  @ApiModelProperty(value = "是否自定义")
  @TableField("is_custom")
  @Excel(name = "是否自定义", replace = {"是_true", "否_false", "_null"})
  private Boolean isCustom;

  /**
   * 是否删除 0未删除 1已删除
   */
  @ApiModelProperty(value = "是否删除 0未删除 1已删除")
  @TableField("is_delete")
  @Excel(name = "是否删除 0未删除 1已删除")
  private Integer isDelete;


  @Builder
  public CmsTemplate(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime,
      Long updateUser,
      String name, String config, Boolean isCustom, Integer isDelete) {
    this.id = id;
    this.createTime = createTime;
    this.createUser = createUser;
    this.updateTime = updateTime;
    this.updateUser = updateUser;
    this.name = name;
    this.config = config;
    this.isCustom = isCustom;
    this.isDelete = isDelete;
  }

}
